<template>
	<view>

		<view class="bg_box">
			<!-- <image class="bg01" src="../../static/depot/bg.png"
				mode="widthFix">
			</image> -->
			<view class="header status_bar" :class="scrrol == true ? 'scrrolHeader' : ''">
				<view class="back iconfont" @tap="backPage">&#xe8c8;</view>
				<view class="text">团队审核</view>
			</view>
			<view class="bg_content">


				<view class="nav">
					<view class="navauto">
						<block v-for="(item, index) in menu" :key="index">
							<view class="menu" :data-index="index" @tap="setNavMenu">
								<view class="text" :class="index == select ? 'menucolor' : ''">{{ item.text }}</view>
								<!-- <view class="line" :class="index == select ? 'menucolor02' : ''">
									<image :src="'https://cxh-imgs.oss-cn-shanghai.aliyuncs.com/static/' + 'xiao.png'"
										mode="widthFix"></image>
								</view> -->
							</view>
						</block>
					</view>
				</view>

				<block v-for="(item, index) in info" :key="index" v-if="select == 0 && item.st==0" >
					<view class="other_box">
						<view class="text_box">
							<view class="title">
								<view class="t">{{item.name}}</view>
								<view class="lv">{{item.lv_id}}</view>
							</view>
							<view class="time">申请时间:{{item.time}}</view>
						</view>
						<view class="menu_box" v-if="select == 0">
							<view class="menu menu02"  @click="n" :data-id="item.id">拒绝</view>
							<view class="menu" @click="y" :data-id="item.id">通过</view>							
						</view>
					
					</view>
				</block>




				<block v-for="(item, index) in info" :key="index" v-if="select == 1 && item.st>0" >
					<view class="other_box">
						<view class="text_box">
							<view class="title">
								<view class="t">{{item.name}}</view>
								<view class="lv">{{item.lv_id}}</view>
							</view>
							<view class="time">申请时间:{{item.time}}</view>
						</view>
					
						<view class="menu_box" v-if="select == 1">
							<view class="menu menu02" v-if="item.st==2">已拒绝</view>
							<view class="menu menu02" v-if="item.st==1">已通过</view>			
											<view class="menu menu02" v-if="item.st==3">已失效</view>	
						</view>
					</view>
				</block>


			</view>
		</view>




	</view>
</template>

<script>
	export default {
		data() {
			return {
				scrrol: false,
				select: 0,
				info: [


				],
				
				menu: [{
						text: '待处理'
					},
					{
						text: '已处理'
					},
				],
				page: 1,
				using_num: 0,
				used_num: 0,
			}
		},
		onLoad(e) {
			let that = this;

		},
		onShow() {
			let that = this;
			that.page = 1;
			that.loadData();
		},
		methods: {
			y(e) {
				var that = this;
				let id = e.currentTarget.dataset.id;
				uni.showModal({
				    title: '提示',
				    content:'是否确认通过',
				    success: function (res) {
				        if (res.confirm) {
				          that.Net._get('td_qr',{td_id:id},(res)=>{
				          	if(res.code ==1){
				          		that.Msg.Success(res.msg,(res)=>{
				          			that.loadData();
				          		})
				          	}
				          });
				        } else if (res.cancel) {
				            //console.log('用户点击取消');
				        }
				    }
				});
					
					
			},
			n(e) {
				var that = this;
				let id = e.currentTarget.dataset.id;
				uni.showModal({
				    title: '提示',
				    content:'是否确认拒绝',
				    success: function (res) {
				        if (res.confirm) {
				          that.Net._get('td_qx',{td_id:id},(res)=>{
				          	if(res.code ==1){
				          		that.Msg.Success(res.msg,(res)=>{
				          			//that.lord();
				          		})
				          	}
				          });
				        } else if (res.cancel) {
				            //console.log('用户点击取消');
				        }
				    }
				});
					
					
			},
			loadData() {
				let that = this;
				that.Net._get('td_sh', {
					
				}, res => {
					if (res.code == 1) {
						// console.log(res.data);
						that.info = res.data;
					
					}
				});
			},
			setNavMenu(e) {
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.select = index;
				that.page = 1;
			//	that.loadData()
			},
			setCoupin(e) {
				let that = this;
				let index = e.currentTarget.dataset.index;
				that.select = index
			},
			backPage() {
				uni.navigateBack({});
			},
			gotopage(e) {
				let url = e.currentTarget.dataset.url;
				uni.navigateTo({
					url: url
				});
			},
		},
		onPageScroll: function(Object) {
			//console.log(Object.scrollTop); //实时获取到滚动的值
			if (Object.scrollTop > 28) {
				this.scrrol = true;
				/* #ifdef APP-PLUS */
				/* #endif */
			} else if (Object.scrollTop < 28) {
				this.scrrol = false;
				/* #ifdef APP-PLUS */
				/* #endif */
			}
		},
		onPullDownRefresh() {
			//监听下拉刷新动作的执行方法，每次手动下拉刷新都会执行一次
			let that = this;
			that.page = 1;
			that.info = [];
			setTimeout(function() {
				uni.stopPullDownRefresh();
				that.loadData();
			}, 500);
		},
		onReachBottom() {
			// var that = this;
			// that.page++;
			// that.Net._get('user/coupons', {
			// 	status: that.select,
			// 	page: that.page,
			// 	per_page: '10'
			// }, res => {
			// 	if (res.code == 200) {
			// 		//console.log(res)
			// 		if (res.data.data == '') {
			// 			uni.showToast({
			// 				title: '到底了~',
			// 				duration: 2000,
			// 				icon: 'none'
			// 			});
			// 		} else {
			// 			that.info = that.info.concat(res.data.data); //将数据拼接在一起
			// 		}
			// 	} else if (res.code == 0) {
			// 		that.Msg.Success(res.msg, res => {});
			// 	}
			// });
		},
	}
</script>

<style>
	.header {
		background-color: #4d726f ;
		color: #fff;
	}
	
	.header .back {
		color: #fff;
	}

	.header .text {
		background-color: #4d726f ;
		color: #fff;
	}

	.clear_box07 {
		height: 27vw;
	}

	.bg_box {
		width: 100%;
		position: relative;
	}

	.bg_box .bg01 {
		width: 100%;
		display: block;
	}

	.bg_box .bg_content {
		width: 92%;
		position: absolute;
		left: calc(50% - 46%);
		top: calc(18vw + var(--status-bar-height));
		z-index: 999;
	}

	.coupon_box {
		width: 100%;
		position: relative;
	}

	.coupon_box image {
		width: 100%;
		display: block;
	}

	.coupon_box .coupon_content {
		width: 100%;
		height: 100%;
		position: absolute;
		left: 0;
		top: 0;
		display: flex;
		align-items: center;
	}

	.coupon_box .coupon_content .text_box {
		flex: 1;
	}

	.coupon_box .coupon_content .title {
		font-size: 7vw;
		color: #fff;
		font-weight: bold;
		text-align: center;
		display: flex;
		align-items: center;

	}

	.coupon_box .coupon_content .num {
		font-size: 3.8vw;
		color: #fff;
		text-align: center;
		margin-top: 2vw;
	}

	.other_box {
		width: 100%;
		background-color: #fff;
		border-radius: 4vw;
		padding: 5vw 3vw;
		margin-top: 4%;
		display: flex;
		align-items: center;
	}

	.other_box .icon {
		width: 10vw;
		margin-right: 3vw;
	}

	.other_box .icon image {
		width: 100%;
		display: block;
	}

	.other_box .text_box {
		flex: 1;
	}

	.other_box .text_box .title {
		display: flex;
		align-items: center;
	}
	
	.other_box .text_box .title .t{
		font-size: 4vw;
		color: #333;
		font-weight: bold;
		margin-right: 1vw;
	}
	
	.other_box .text_box .title .lv{
		height: 5vw;
		border-radius: 5vw;
		padding: 0 3vw;
		line-height: 5vw;
		color: #fff;
		background-color: #4d726f ;
		font-size: 3vw;
	}

	.other_box .text_box .time {
		font-size: 3.3vw;
		color: #666;
		margin-top: 2vw;
	}
	
	.other_box .menu_box{
		flex: 1;
		display: flex;
		justify-content: flex-end;
	}
	
	.other_box .menu_box .menu{
		width: 16vw;
		height: 7vw;
		border-radius: 7vw;
		line-height: 7vw;
		font-size: 3.5vw;
		color: #fff;
		background-color: #4d726f;
		text-align: center;
	}
	
	.other_box .menu_box .menu02{
		color: #fff;
		background-color: #999;

	}
	
	.other_box .menu_box .menu:nth-child(1){
		margin-right: 2vw;
	}

	.other_box .number {
		flex: 1;
		display: flex;
		height: 100%;
		align-items: center;
		justify-content: flex-end;
	}

	.other_box .number .num {
		font-size: 4.5vw;
		font-weight: bold;
		color: #FF3836;
		margin-right: 2vw;
	}

	.other_box .number .num02 {
		font-size: 4.5vw;
		font-weight: bold;
		color: #333;
		margin-right: 2vw;
	}

	.other_box .number .b {
		width: 6vw;
	}

	.other_box .number .b image {
		width: 100%;
	}


	.nav {
		width: 100%;
		height: 13.5vw;
		overflow: hidden;
		overflow-x: auto;
		/* background-color: #fff;
			border-bottom: 1px solid #e8e8e8; */
		box-sizing: border-box;
	}

	.nav .navauto {
		width: fit-content;
		display: flex;
		/* margin-left: 4%; */
		min-width: 100%;
	}

	.nav .navauto .menu {
		width: 50%;
		position: relative;
	}

	.nav .navauto .menu .text {
		font-size: 4vw;
		color: #333;
		text-align: center;
		line-height: 13.5vw;
	}

	.nav .navauto .menu .line {
		width: 10%;
		border-radius: 3vw;
		position: absolute;
		left: calc(50% - 5%);
		bottom: 0vw;
		display: none;
	}

	.nav .navauto .menu .line image {
		width: 100%;
	}

	.menucolor {
		color: #4d726f !important;
		font-weight: bold;
		font-size: 4.5vw !important;
	}

	.menucolor02 {
		display: block !important;
	}

	.menucolor03 {
		background-color: #4d726f !important;
	}

	.scrrolHeader {
		background-color: #4d726f !important;
	}
</style>